<template>
  <el-card>
    <el-tree
      :data="departs"
      :props="defaultProps"
      :default-expand-all="true"
    >
      <div slot-scope="{ data }">
        <span>{{ data.name }}</span>
      </div>
    </el-tree>
  </el-card>
</template>

<script>

export default {
  name: 'Test',
  data () {
    return {
      defaultProps: {
        label: 'name'
      },
      departs: [
        { name: '总裁办', children: [{ name: '董事会' }] },
        { name: '行政部' },
        { name: '人事部' }]
    }
  }
}
</script>

<style lang="scss" scoped>
.el-card {
  padding: 20px;
  margin: 20px;
}
</style>
